#include <iostream>

#include "mini_heap.h"
#include "leetcode.h"
#include "rbtree.h"
#include "kmp.h"

using namespace std;

int main() {
	vector<int> seq {0,3,7,2,5,8,4,6,0,1};
	int count = longestConsecutive(seq);
	cout << "count:" << count << endl;

	//RBTree<int, int> rb;

	MinHeap<int> minh;
	minh.push(290);
	minh.push(3);
	minh.push(1);
	minh.push(5);
	minh.push(9);
	int tmp;
	int i = 0;
	while (minh.try_pop(tmp)) {
		cout << "index: " << i << " => " << tmp << endl;
		i++;
	}

	std::string pat = "ABCDABD";
	auto tbl = pattern_table(pat);
	for (auto i : tbl) {
		cout << " "<< i;
	}
	cout << endl;
	std::string ctx = "ABC ABCDAB ABCDABCDABDE";
	cout << kmp_search(ctx, pat) << endl;
	return 0;
}
